找传奇、传世资源到传世资源站!

百度人体检测

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

使用百度智能进行人体检测
from clipboard
 public static string body_attr(string Token, string base64)
        {
            StringBuilder sb = new StringBuilder();
            try
            {
                string token = Token;
                string host = "https://aip.baidubce.com/rest/2.0/image-classify/v1/body_attr?access_token=" token;
                Encoding encoding = Encoding.Default;
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(host);
                request.Method = "post";
                request.KeepAlive = true;
                // 图片的base64编码
                String str = "image=" HttpUtility.UrlEncode(base64);
                byte[] buffer = encoding.GetBytes(str);
                request.ContentLength = buffer.Length;
                request.GetRequestStream().Write(buffer, 0, buffer.Length);
                HttpWebResponse response = (HttpWebResponse)request.GetResponse();
                StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
                string result = reader.ReadToEnd();
                sb.Append("人体检测和属性识别:" "\r\n");
                sb.Append(result "\r\n");
            }
            catch { }
            return sb.ToString();
        }

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复